{% block sw_seo_url %}
<div class="sw-seo-url">
    <mt-card
        class="sw-seo-url__card"
        position-identifier="sw-seo-url"
        :title="$tc('sw-seo-url.titleCard')"
        :is-loading="isLoading"
    >
        {% block sw_seo_url_card %}
        <template v-if="showEmptySeoUrlError">
            {{ $tc('sw-seo-url.textEmptySeoUrls') }}
        </template>

        <template v-else>
            {% block sw_seo_url_card_seo_path %}
            <sw-inherit-wrapper
                v-model:value="currentSeoUrl.seoPathInfo"
                :has-parent="currentSalesChannelId !== null && !isHeadlessSalesChannel && hasDefaultTemplate"
                :inherited-value="(currentSeoUrl.salesChannelId !== null && !isHeadlessSalesChannel) ? defaultSeoUrl.seoPathInfo : null"
            >

                <template #content="props">
                    {% block sw_seo_url_card_seo_path_edit %}

                    <mt-text-field
                        :is-inheritance-field="props.isInheritField"
                        :is-inherited="props.isInherited"
                        :model-value="props.currentValue"
                        :disabled="props.isInherited || isHeadlessSalesChannel || !allowInput"
                        :disable-inheritance-toggle="isHeadlessSalesChannel"
                        :label="$tc('sw-seo-url.labelSeoPathInfo')"
                        :help-text="seoUrlHelptext"
                        @update:model-value="props.updateCurrentValue"
                        @inheritance-restore="props.restoreInheritance"
                        @inheritance-remove="props.removeInheritance"
                    />
                    {% endblock %}
                </template>

            </sw-inherit-wrapper>
            {% endblock %}
        </template>

        {% block sw_seo_url_card_toolbar %}
        <template
            v-if="!showEmptySeoUrlError"
            #toolbar
        >
            <sw-sales-channel-switch
                ref="salesChannelSwitch"
                :disabled="disabled || undefined"
                :label="$tc('sw-seo-url.labelSalesChannelSelect')"
                @change-sales-channel-id="onSalesChannelChanged"
            />
        </template>
        {% endblock %}

        <div
            v-if="hasAdditionalSeoSlot"
            class="sw-seo-url__card-seo-additional"
        >
            <slot
                name="seo-additional"
                v-bind="{currentSalesChannelId}"
            >
                {% block sw_seo_url_additional %}{% endblock %}
            </slot>
        </div>

        {% endblock %}
    </mt-card>
</div>
{% endblock %}
